package com.tracker.impl;

import java.util.List;
import java.util.HashSet;
import java.util.Set;

import com.tracker.bean.LoggerPoints;
import com.tracker.session.LoggerPointsSession;


public class LoggerPointsImpl {
	
	public void save(LoggerPoints loggerPoints) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->SAVE  ########################");
			(new LoggerPointsSession()).add(loggerPoints);
		} catch (Exception e) {
			e.printStackTrace();
		}
	}

	public LoggerPoints get(LoggerPoints loggerPoints) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->GET  ########################");
			return (new LoggerPointsSession()).get(loggerPoints);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public LoggerPoints getLastCoord(LoggerPoints loggerPoints) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->GET  ########################");
			return (new LoggerPointsSession()).getLastCoord(loggerPoints);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

	public Set list(String imei, String dateI, String dateF) {
		try {
			System.out.println("######################### "+ this.getClass().getSimpleName()+ "->LIST  ########################");
			System.out.println(imei + " - " + dateI + " - " + dateF);
			return (new LoggerPointsSession()).list(imei, dateI, dateF);
		} catch (Exception e) {
			e.printStackTrace();
		}
		return null;
	}

}
